home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / SOUND.dxr / 00162.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  1.0 KB  |  29 lines

  1. on mouseDown me
  2.   set the cursor of sprite the spriteNum of me to [member "Closed Hand", member "Closed Hand Mask"]
  3.   repeat while the stillDown
  4.     if (the mouseH > 185) and (the mouseH < 607) then
  5.       set the locH of sprite 5 to the mouseH
  6.       set DV to the locH of sprite 5 - 185
  7.       set DV to DV / 19
  8.       set DV to (DV * 40) + 140
  9.       put DV into field "frequency"
  10.       puppetSound(field "frequency" & ".aif")
  11.       set DH to ((1020 - field "frequency") / 20 * 50) + 452
  12.       spriteBox(3, the left of sprite 3, the top of sprite 3, 452 + DH, the bottom of sprite 3)
  13.       set the floatPrecision to 5
  14.       put "f =" & field "frequency" & " Hz, P =" & 1.0 / float(field "frequency") & " sec." into field "FD"
  15.       updateStage()
  16.     end if
  17.   end repeat
  18.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  19.   updateStage()
  20. end
  21.  
  22. on beginSprite me
  23.   set the cursor of sprite the spriteNum of me to [member "Hand", member "Hand Mask"]
  24. end
  25.  
  26. on endSprite me
  27.   set the cursor of sprite the spriteNum of me to 0
  28. end
  29.